package com.csu.ds;

import java.sql.Date;

public class ExpdItem implements Comparable<ExpdItem>{
    private int sN;//series number 序号
    private String type;//支出种类
    private String person;

    public String getPerson() {
        return person;
    }

    public void setPerson(String person) {
        this.person = person;
    }

    private double amount;//支出金额
    private Date date;//支出时间

    public ExpdItem(){

    }

    public int getSN() {
        return sN;
    }

    public void setSN(int sN) {
        this.sN = sN;
    }

    public ExpdItem(String type, double amount, Date date) {
        this.type = type;
        this.amount = amount;
        this.date = date;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public int compareTo(ExpdItem o) {
        return (- Integer.compare(this.getSN(), o.getSN()) ); //使其按序号降序排序
    }
}
